export default {
    install(Vue, options = {}) {
      Vue.prototype.$toast = {
        success(message, title = '成功') {
          Vue.prototype.$notify({
            title,
            message,
            type: 'success',
            duration: options.duration || 3000
          })
        },
        error(message, title = '错误') {
          Vue.prototype.$notify({
            title,
            message,
            type: 'error',
            duration: options.duration || 3000
          })
        },
        info(message, title = '提示') {
          Vue.prototype.$notify({
            title,
            message,
            type: 'info',
            duration: options.duration || 3000
          })
        },
        warning(message, title = '警告') {
          Vue.prototype.$notify({
            title,
            message,
            type: 'warning',
            duration: options.duration || 3000
          })
        }
      }
    }
  }